c86390e62a02d87fe889c4d96b6e85a57f46673b,clc/modules/image-manager/src/main/java/com/eucalyptus/blockstorage/SnapshotManager.java,SnapshotManager,delete,#DeleteSnapshotType#,179
Before Change
db.delete( snap );
db.getSession( ).flush( );
StorageUtil.dispatchAll( new DeleteStorageSnapshotType( snap.getDisplayName( ) ) );
db.commit( );
EventRecord.here( SnapshotManager.class, EventClass.SNAPSHOT, EventType.SNAPSHOT_DELETE, "user=" + snap.getUserName( ), "snapshot=" + snap.getDisplayName( ) ).info( );
} catch ( EucalyptusCloudException e ) {
LOG.debug( e, e );
After Change
DeleteStorageSnapshotResponseType scReply = StorageUtil.send( snap.getCluster( ), new DeleteStorageSnapshotType( snap.getDisplayName( ) ) );
if ( scReply.get_return( ) ) {
StorageUtil.dispatchAll( new DeleteStorageSnapshotType( snap.getDisplayName( ) ) );
db.commit( );
EventRecord.here( SnapshotManager.class, EventClass.SNAPSHOT, EventType.SNAPSHOT_DELETE, "user=" + snap.getUserName( ), "snapshot=" + snap.getDisplayName( ) ).info( );
} else {
db.rollback();
throw new EucalyptusCloudException( "Unable to delete snapshot." );
}
} catch ( EucalyptusCloudException e ) {